package com.laiketui.order.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.laiketui.domain.mch.MchModel;
import com.laiketui.domain.product.ProductListModel;
import com.laiketui.domain.user.User;
import com.laiketui.order.api.dto.ConfirmOrderDTO;
import com.laiketui.order.api.dto.ConfirmOrderParentDTO;
import com.laiketui.order.api.dto.OrderParentDTO;
import com.laiketui.order.api.dto.PlaceOrderResultDTO;
import com.laiketui.order.api.params.*;
import com.laiketui.order.domain.Order;
import com.laiketui.order.domain.OrderDetail;
import com.laiketui.order.domain.OrderParent;
import com.laiketui.order.entity.OrderCombiner;

import java.util.List;
import java.util.Map;

/**
* @author jiangxiang
* @description 针对表【lk_order_parent】的数据库操作Service
* @createDate 2024-08-14 22:28:14
*/
public interface OrderParentService extends IService<OrderParent> {

    OrderCombiner getOrderCombiner(UserPlaceOrderParams userPlaceOrderParams, List<ProductListModel> productModelLists);

    //
    OrderParentDTO submitOrder(UserPlaceOrderParams userPlaceOrderParams,boolean isDelCarts);

    //下单
    String placeOrder(PlaceOrderParams orderVo,User user);

    ConfirmOrderParentDTO confirmOrder(ConfirmOrderParams confirmOrderParams,User user);

    PlaceOrderResultDTO orderInfo(OrderInfoParams orderInfoParams, User user);

    //用户订单列表
    Page<OrderParentDTO> orderList(OrderParentListParams orderParentListParams, User user);

    OrderParentDTO orderDetail(OrderInfoParams orderInfoParams, User user);

    /*
    * @Description 取消订单
     */
    boolean updateStatusCancel(String orderParentNo,String cancelReason);

    /**
     * 根据母单号查询
     * @param orderParentNo
     * @return
     */
    OrderParent getOrderParent(String orderParentNo);

    /**
     * 根据多个订单号获取母单信息
     * @param orderParentNos
     * @return
     */
    List<OrderParent> getByOrerParentNoList(List<String> orderParentNos);

    /**
     * 根据母单号跟新
     * @param orderParentNo 母单号
     * @param orderParent 母单信息
     * @return
     */
    boolean updateByOrderParentNo(String orderParentNo, OrderParent orderParent);
}

